<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script language="javascript">
			str="2,2,3,5,6,6"; //这是一字符串
			var strs= new Array(); //定义一数组
			strs=str.split(","); //字符分割
			document.write(strs.length); //分割后的字符输出
			for (i=0;i<strs.length ;i++ )
			{
			document.write(strs[i]+"<br/>"); //分割后的字符输出
			}
</script> 
	</body>
</html>
